<!--#layout("/common/space.page.html",{"jsBase":"/js/space/news/","title":"首页"}){  -->

<form class="layui-hide" id="searchForm">
	<input type="text" value="${parameter.catalogId!}" name="catalogId" />
</form>
<div class="line align-center">
	<a href="/space/news/edit.do" class="button bg-info button-block">发布新闻</a>
</div>

<!--# var limit = parameter.limit!10;  -->
<layui:cmsArticleList var="articlePage" catalogId="126" orderby="show_time desc" page="${parameter.page!'1'}" pageSize="${ stringUtil.toString(limit)}">
	<div class="layui-row">
		<div class="clearfix">
				<!--#
			for(article in articlePage.list) {
			  -->
			  <div class="line-big margin-top">
			  	<div class="float-left">
			  		<a href="${ctxPath }/article.do?id=${article.id }" class="info float-left">
			        	${article.title }
			        </a>
			  	</div>
			  	<div class="float-right margin-left">
			  		<a href="/space/news/edit.do?id=${article.id}" class="button bg-sub">编辑</a>
			  	</div>
		        <div class="float-right">${article.showTime,dateFormat="yyyy年MM月dd"}</div>
		    </div>
				<!--#} -->
		</div>
		<div id="page"></div>
		<script>
		layui.use(['laypage'],function() {
			var laypage = layui.laypage;
			//完整功能
			  laypage.render({
			    elem: 'page'
			    ,count: ${articlePage.totalRow!0}
			    ,curr:${parameter.page!1}
			    ,limit:${limit}
			    ,layout: ['count', 'prev', 'page', 'next', 'limit', 'refresh', 'skip']
			    ,jump: function(obj,first){
			      console.log(obj.curr);
			      console.log(obj.limit);
			      //首次不执行
			      if(!first){
			    	  if (obj.limit == '${limit}') {
			    		  document.location.href="/space/news/index.do?page=" + obj.curr;
			    	  } else {
			    		  document.location.href="/space/news/index.do?page=" + obj.curr + "&limit=" + obj.limit;
			    	  }
			      }
			    }
			  });
		})
		</script>
	</div>
</layui:cmsArticleList>
<!--#} -->
